STEP 5: Let's create our first if statement! First we'll test if the user chose "beach".

The test statement has two parts: the test variable and the test value. The test value is after the ==.

  • In the LOGIC tab, click on and drag out if. Drop it at the bottom of your program.
  • Change the test value to "beach".

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)